add_library(splashw SHARED)
if (WIN32)
    target_sources(splashw PRIVATE dllmain.c splash.c splash.h splash.rc)
    target_compile_definitions(splashw PRIVATE -DUNICODE -D_UNICODE)
elseif (UNIX AND NOT APPLE)
    target_sources(splashw PRIVATE linux.cpp)
else()
    target_sources(splashw PRIVATE dummy.cpp)
endif()
if (UNIX AND NOT APPLE)
    set_target_properties(splashw PROPERTIES OUTPUT_NAME splashw1z)
    find_package(X11)
    if (X11_FOUND)
        target_include_directories(splashw PRIVATE ${X11_INCLUDE_DIR})
        target_link_libraries(splashw PRIVATE ${X11_LIBRARIES})
        target_include_directories(splashw PRIVATE ../../../3rd/include .)
    endif()
endif()
install(TARGETS splashw RUNTIME DESTINATION bin COMPONENT "splashscreen")
